import re
import json

def remove_comments(json_like_str):
    # 删除单行注释
    json_str = re.sub(r'//.*$', '', json_like_str, flags=re.MULTILINE)
    # 删除多行注释
    json_str = re.sub(r'/\*.*?\*/', '', json_str, flags=re.DOTALL)
    return json_str

def read_json(config_file):
    with open(config_file, "r", encoding="utf-8") as f:
        content = f.read()
    cleaned = remove_comments(content)
    config = json.loads(cleaned)  
    return config